<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="../../jQuery/jquery-3.4.1.js"></script>
		<script type="text/javascript">
			$(function(){
				var txt=$("#search").val();
				
				$("#search").focus(function(){
					if($(this).val()==txt){
						$(this).val("");
					}
				});
				$("#search").blur(function(){
					if($(this).val()==""){
						$(this).val(txt);
					}
				});
			})
		</script>
	</head>
	<body>
		<input type="text" id="search" value="百度一下,你就知道!"> <input type="button" id="btn" value="搜索">
	</body>
</html>
